#pragma once

namespace DataStream
{
	DWORD	ReadDWORD(const BYTE* pData);
	WORD	ReadWORD(const BYTE* pData);
	BYTE	ReadBYTE(const BYTE* pData);
	BYTE*	ReadBYTES(const BYTE* pData, WORD wLen, BYTE* pToBuff);
	WORD	ReadNoNetWORD(BYTE* pData);
	DWORD	ReadNoNetDWORD(BYTE* pData);

	WORD	WriteDWORD(BYTE* pBuff, WORD wPos, DWORD dwValue);
	WORD	WriteWORD (BYTE* pBuff, WORD wPos, WORD wValue);
	WORD	WriteBYTES(BYTE* pBuff, WORD wPos, WORD wLen, const BYTE* pByte);
	WORD	WriteBYTE (BYTE* pBuff, WORD wPos, BYTE bValue);
	WORD	WriteNoNetWORD(BYTE* pBuff, WORD wPos, WORD wValue);
	WORD	WriteNoNetDWORD(BYTE* pBuff, WORD wPos, WORD wValue);

	WORD*	MutilByteToUnicode(WORD* dest, WORD nLen, const BYTE* szSrc);
	BYTE*	UnicodeToMutilByte(BYTE* dest, WORD nLen, const WORD* ssBuffer);

	DWORD	HTONL(DWORD dwValue);
	WORD	HTONS(WORD wValue);

	DWORD	NTOHL_1(DWORD dwValue);
	WORD	NTOHS(WORD wValue);
};
